package com.rran.study.designpattern.structural.proxy;

/**
 * @author yy
 * @Type Proxy.java
 * @Desc
 * @date 2020/7/27 11:36
 */
public class MyProxy implements Subject{
    private RealSubject realSubject;

    public MyProxy(){
        realSubject = new RealSubject();
    }

    @Override
    public void request() {
        preRequest();
        realSubject.request();
        postRequest();
    }

    public void preRequest() {
        System.out.println("访问真实主题之前的预处理。");
    }

    public void postRequest() {
        System.out.println("访问真实主题之后的后续处理。");
    }
}
